package com.cn.ycy.dto;

import java.io.Serializable;

public class ResResult<T extends Serializable>  implements Serializable {

  private static final long serialVersionUID = 1L;
  private boolean success;
  private String code;
  private String message;
  private T data;

  public ResResult() {
    this.success = true;
  }

  public ResResult(String code, String message) {
    this(true, code, message);
  }

  public ResResult(boolean success, String code, String message) {
    this(success, code, message, null, (Throwable)null);
  }

  public ResResult(boolean success, String code, String message, T data) {
    this(success, code, message, data, (Throwable)null);
  }

  public ResResult(T data) {
    this.success = true;
    this.code = "200";
    this.data = data;
  }

  public ResResult(boolean success, String code, String message, T data, Throwable cause) {
    this.success = true;
    this.success = success;
    this.code = code;
    this.message = message;
    this.data = data;
  }

  public static long getSerialVersionUID() {
    return serialVersionUID;
  }

  public boolean isSuccess() {
    return success;
  }

  public void setSuccess(boolean success) {
    this.success = success;
  }

  public String getCode() {
    return code;
  }

  public void setCode(String code) {
    this.code = code;
  }

  public String getMessage() {
    return message;
  }

  public void setMessage(String message) {
    this.message = message;
  }

  public T getData() {
    return data;
  }

  public void setData(T data) {
    this.data = data;
  }
}
